Python tricks for problem-solving